function outSig=callVensim(venDir,cmdFile,maxTrial)
% test if there is a max trial, and if so uses that, else, set it to 10
if nargin<3
    maxTrial=10;
end
outSig=1;
numTrial=0;
while ~(outSig==0) && numTrial<maxTrial
    outSig=system(['"' venDir '" "' cmdFile '"']);          % This is the main line calling Vensim and passing it the relevant command file
end
end